package com.sxj.springsourcecode.enity;

import com.sxj.springsourcecode.springframework.factory.config.InitializationBean;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;

/**
 * @ProjectName: spring-source-code
 * @Package: com.sxj.springsourcecode.enity
 * @ClassName: UserService
 * @Author: sxj
 * @Description:
 * @Date: 2024/2/21 10:51
 * @Version: 1.0.0
 */
@Slf4j
@Data
public class UserService implements InitializationBean {
    private String userId;

    private String company;

    private String address;
    private UserDao userDao;

    public UserService() {
    }

    public UserService(String userId) {
        this.userId = userId;
    }


    public void queryUser(){
        userDao.queryUser(userId);
        log.info("公司是：{}，地址是：{}",company,address);
    }

    public void init(){
        log.info("正在调用usrId:{}的初始化方法！",userId);
    }

    @Override
    public void afterPropertiesSet() {
        log.info("正在调用usrId:{}的afterPropertiesSet方法！",userId);
    }

    public void destory(){
        log.info("在调用:{}的销毁方法",this.getClass().getSimpleName());
    }
}
